#include <stdio.h>
#include "iic_function.h"
#include "aos/hal/i2c.h"
#include "camera_config.h"
#include "drv_isp.h"
#include <string.h>

#define AR0230_REG_CHIPID 	0x3000
static i2c_dev_t i2c_ar0230;

const  regval_list AR0230_Init_regs[] = {
{0x3088, 0x8000}, // SEQ_CTRL_PORT - [0:00:06.511]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:06.517]
{0x3086, 0x729B}, // SEQ_DATA_PORT - [0:00:06.520]
{0x3086, 0x4A31}, // SEQ_DATA_PORT - [0:00:06.523]
{0x3086, 0x4342}, // SEQ_DATA_PORT - [0:00:06.525]
{0x3086, 0x8E03}, // SEQ_DATA_PORT - [0:00:06.529]
{0x3086, 0x2A14}, // SEQ_DATA_PORT - [0:00:06.532]
{0x3086, 0x4578}, // SEQ_DATA_PORT - [0:00:06.534]
{0x3086, 0x7B3D}, // SEQ_DATA_PORT - [0:00:06.537]
{0x3086, 0xFF3D}, // SEQ_DATA_PORT - [0:00:06.540]
{0x3086, 0xFF3D}, // SEQ_DATA_PORT - [0:00:06.543]
{0x3086, 0xEA2A}, // SEQ_DATA_PORT - [0:00:06.546]
{0x3086, 0x043D}, // SEQ_DATA_PORT - [0:00:06.549]
{0x3086, 0x102A}, // SEQ_DATA_PORT - [0:00:06.552]
{0x3086, 0x052A}, // SEQ_DATA_PORT - [0:00:06.555]
{0x3086, 0x1535}, // SEQ_DATA_PORT - [0:00:06.558]
{0x3086, 0x2A05}, // SEQ_DATA_PORT - [0:00:06.561]
{0x3086, 0x3D10}, // SEQ_DATA_PORT - [0:00:06.564]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:06.567]
{0x3086, 0x2A04}, // SEQ_DATA_PORT - [0:00:06.570]
{0x3086, 0x2A14}, // SEQ_DATA_PORT - [0:00:06.573]
{0x3086, 0x3DFF}, // SEQ_DATA_PORT - [0:00:06.575]
{0x3086, 0x3DFF}, // SEQ_DATA_PORT - [0:00:06.577]
{0x3086, 0x3DEA}, // SEQ_DATA_PORT - [0:00:06.580]
{0x3086, 0x2A04}, // SEQ_DATA_PORT - [0:00:06.582]
{0x3086, 0x622A}, // SEQ_DATA_PORT - [0:00:06.585]
{0x3086, 0x288E}, // SEQ_DATA_PORT - [0:00:06.587]
{0x3086, 0x0036}, // SEQ_DATA_PORT - [0:00:06.590]
{0x3086, 0x2A08}, // SEQ_DATA_PORT - [0:00:06.592]
{0x3086, 0x3D64}, // SEQ_DATA_PORT - [0:00:06.595]
{0x3086, 0x7A3D}, // SEQ_DATA_PORT - [0:00:06.597]
{0x3086, 0x0444}, // SEQ_DATA_PORT - [0:00:06.600]
{0x3086, 0x2C4B}, // SEQ_DATA_PORT - [0:00:06.602]
{0x3086, 0x8F00}, // SEQ_DATA_PORT - [0:00:06.605]
{0x3086, 0x430C}, // SEQ_DATA_PORT - [0:00:06.607]
{0x3086, 0x2D63}, // SEQ_DATA_PORT - [0:00:06.610]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.612]
{0x3086, 0x8E03}, // SEQ_DATA_PORT - [0:00:06.615]
{0x3086, 0x2AFC}, // SEQ_DATA_PORT - [0:00:06.617]
{0x3086, 0x5C1D}, // SEQ_DATA_PORT - [0:00:06.620]
{0x3086, 0x5754}, // SEQ_DATA_PORT - [0:00:06.622]
{0x3086, 0x495F}, // SEQ_DATA_PORT - [0:00:06.625]
{0x3086, 0x5305}, // SEQ_DATA_PORT - [0:00:06.627]
{0x3086, 0x5307}, // SEQ_DATA_PORT - [0:00:06.630]
{0x3086, 0x4D2B}, // SEQ_DATA_PORT - [0:00:06.632]
{0x3086, 0xF810}, // SEQ_DATA_PORT - [0:00:06.635]
{0x3086, 0x164C}, // SEQ_DATA_PORT - [0:00:06.637]
{0x3086, 0x0855}, // SEQ_DATA_PORT - [0:00:06.640]
{0x3086, 0x562B}, // SEQ_DATA_PORT - [0:00:06.642]
{0x3086, 0xB82B}, // SEQ_DATA_PORT - [0:00:06.645]
{0x3086, 0x984E}, // SEQ_DATA_PORT - [0:00:06.647]
{0x3086, 0x1129}, // SEQ_DATA_PORT - [0:00:06.650]
{0x3086, 0x0429}, // SEQ_DATA_PORT - [0:00:06.652]
{0x3086, 0x8429}, // SEQ_DATA_PORT - [0:00:06.655]
{0x3086, 0x9460}, // SEQ_DATA_PORT - [0:00:06.657]
{0x3086, 0x5C19}, // SEQ_DATA_PORT - [0:00:06.660]
{0x3086, 0x5C1B}, // SEQ_DATA_PORT - [0:00:06.662]
{0x3086, 0x4548}, // SEQ_DATA_PORT - [0:00:06.665]
{0x3086, 0x4508}, // SEQ_DATA_PORT - [0:00:06.668]
{0x3086, 0x4588}, // SEQ_DATA_PORT - [0:00:06.670]
{0x3086, 0x29B6}, // SEQ_DATA_PORT - [0:00:06.672]
{0x3086, 0x8E01}, // SEQ_DATA_PORT - [0:00:06.675]
{0x3086, 0x2AF8}, // SEQ_DATA_PORT - [0:00:06.677]
{0x3086, 0x3E02}, // SEQ_DATA_PORT - [0:00:06.680]
{0x3086, 0x2AFA}, // SEQ_DATA_PORT - [0:00:06.682]
{0x3086, 0x3F09}, // SEQ_DATA_PORT - [0:00:06.685]
{0x3086, 0x5C1B}, // SEQ_DATA_PORT - [0:00:06.687]
{0x3086, 0x29B2}, // SEQ_DATA_PORT - [0:00:06.690]
{0x3086, 0x3F0C}, // SEQ_DATA_PORT - [0:00:06.692]
{0x3086, 0x3E02}, // SEQ_DATA_PORT - [0:00:06.695]
{0x3086, 0x3E13}, // SEQ_DATA_PORT - [0:00:06.697]
{0x3086, 0x5C13}, // SEQ_DATA_PORT - [0:00:06.700]
{0x3086, 0x3F11}, // SEQ_DATA_PORT - [0:00:06.702]
{0x3086, 0x3E0B}, // SEQ_DATA_PORT - [0:00:06.705]
{0x3086, 0x5F2B}, // SEQ_DATA_PORT - [0:00:06.707]
{0x3086, 0x902A}, // SEQ_DATA_PORT - [0:00:06.710]
{0x3086, 0xF22B}, // SEQ_DATA_PORT - [0:00:06.712]
{0x3086, 0x803E}, // SEQ_DATA_PORT - [0:00:06.715]
{0x3086, 0x043F}, // SEQ_DATA_PORT - [0:00:06.717]
{0x3086, 0x0660}, // SEQ_DATA_PORT - [0:00:06.720]
{0x3086, 0x29A2}, // SEQ_DATA_PORT - [0:00:06.722]
{0x3086, 0x29A3}, // SEQ_DATA_PORT - [0:00:06.725]
{0x3086, 0x5F4D}, // SEQ_DATA_PORT - [0:00:06.727]
{0x3086, 0x192A}, // SEQ_DATA_PORT - [0:00:06.730]
{0x3086, 0xFA29}, // SEQ_DATA_PORT - [0:00:06.732]
{0x3086, 0x8345}, // SEQ_DATA_PORT - [0:00:06.735]
{0x3086, 0xA83E}, // SEQ_DATA_PORT - [0:00:06.737]
{0x3086, 0x072A}, // SEQ_DATA_PORT - [0:00:06.740]
{0x3086, 0xFB3E}, // SEQ_DATA_PORT - [0:00:06.742]
{0x3086, 0x2945}, // SEQ_DATA_PORT - [0:00:06.745]
{0x3086, 0x8821}, // SEQ_DATA_PORT - [0:00:06.748]
{0x3086, 0x3E08}, // SEQ_DATA_PORT - [0:00:06.750]
{0x3086, 0x2AFA}, // SEQ_DATA_PORT - [0:00:06.753]
{0x3086, 0x5D29}, // SEQ_DATA_PORT - [0:00:06.755]
{0x3086, 0x9288}, // SEQ_DATA_PORT - [0:00:06.758]
{0x3086, 0x102B}, // SEQ_DATA_PORT - [0:00:06.760]
{0x3086, 0x048B}, // SEQ_DATA_PORT - [0:00:06.763]
{0x3086, 0x1685}, // SEQ_DATA_PORT - [0:00:06.765]
{0x3086, 0x8D48}, // SEQ_DATA_PORT - [0:00:06.768]
{0x3086, 0x4D4E}, // SEQ_DATA_PORT - [0:00:06.770]
{0x3086, 0x2B80}, // SEQ_DATA_PORT - [0:00:06.773]
{0x3086, 0x4C0B}, // SEQ_DATA_PORT - [0:00:06.776]
{0x3086, 0x603F}, // SEQ_DATA_PORT - [0:00:06.778]
{0x3086, 0x282A}, // SEQ_DATA_PORT - [0:00:06.780]
{0x3086, 0xF23F}, // SEQ_DATA_PORT - [0:00:06.783]
{0x3086, 0x0F29}, // SEQ_DATA_PORT - [0:00:06.786]
{0x3086, 0x8229}, // SEQ_DATA_PORT - [0:00:06.788]
{0x3086, 0x8329}, // SEQ_DATA_PORT - [0:00:06.791]
{0x3086, 0x435C}, // SEQ_DATA_PORT - [0:00:06.794]
{0x3086, 0x155F}, // SEQ_DATA_PORT - [0:00:06.796]
{0x3086, 0x4D19}, // SEQ_DATA_PORT - [0:00:06.799]
{0x3086, 0x2AFA}, // SEQ_DATA_PORT - [0:00:06.801]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:06.804]
{0x3086, 0x8E00}, // SEQ_DATA_PORT - [0:00:06.806]
{0x3086, 0x2A98}, // SEQ_DATA_PORT - [0:00:06.809]
{0x3086, 0x3F06}, // SEQ_DATA_PORT - [0:00:06.811]
{0x3086, 0x1244}, // SEQ_DATA_PORT - [0:00:06.814]
{0x3086, 0x4A04}, // SEQ_DATA_PORT - [0:00:06.817]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.819]
{0x3086, 0x0543}, // SEQ_DATA_PORT - [0:00:06.822]
{0x3086, 0x1658}, // SEQ_DATA_PORT - [0:00:06.824]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.827]
{0x3086, 0x5A43}, // SEQ_DATA_PORT - [0:00:06.830]
{0x3086, 0x1606}, // SEQ_DATA_PORT - [0:00:06.832]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.835]
{0x3086, 0x0743}, // SEQ_DATA_PORT - [0:00:06.838]
{0x3086, 0x168E}, // SEQ_DATA_PORT - [0:00:06.840]
{0x3086, 0x032A}, // SEQ_DATA_PORT - [0:00:06.843]
{0x3086, 0x9C45}, // SEQ_DATA_PORT - [0:00:06.845]
{0x3086, 0x787B}, // SEQ_DATA_PORT - [0:00:06.848]
{0x3086, 0x3F07}, // SEQ_DATA_PORT - [0:00:06.850]
{0x3086, 0x2A9D}, // SEQ_DATA_PORT - [0:00:06.853]
{0x3086, 0x3E2E}, // SEQ_DATA_PORT - [0:00:06.856]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:06.858]
{0x3086, 0x253E}, // SEQ_DATA_PORT - [0:00:06.861]
{0x3086, 0x068E}, // SEQ_DATA_PORT - [0:00:06.864]
{0x3086, 0x012A}, // SEQ_DATA_PORT - [0:00:06.866]
{0x3086, 0x988E}, // SEQ_DATA_PORT - [0:00:06.869]
{0x3086, 0x0012}, // SEQ_DATA_PORT - [0:00:06.872]
{0x3086, 0x444B}, // SEQ_DATA_PORT - [0:00:06.874]
{0x3086, 0x0343}, // SEQ_DATA_PORT - [0:00:06.877]
{0x3086, 0x2D46}, // SEQ_DATA_PORT - [0:00:06.880]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.882]
{0x3086, 0xA343}, // SEQ_DATA_PORT - [0:00:06.885]
{0x3086, 0x165D}, // SEQ_DATA_PORT - [0:00:06.888]
{0x3086, 0x0D29}, // SEQ_DATA_PORT - [0:00:06.890]
{0x3086, 0x4488}, // SEQ_DATA_PORT - [0:00:06.894]
{0x3086, 0x102B}, // SEQ_DATA_PORT - [0:00:06.896]
{0x3086, 0x0453}, // SEQ_DATA_PORT - [0:00:06.899]
{0x3086, 0x0D8B}, // SEQ_DATA_PORT - [0:00:06.902]
{0x3086, 0x1685}, // SEQ_DATA_PORT - [0:00:06.904]
{0x3086, 0x448E}, // SEQ_DATA_PORT - [0:00:06.907]
{0x3086, 0x032A}, // SEQ_DATA_PORT - [0:00:06.910]
{0x3086, 0xFC5C}, // SEQ_DATA_PORT - [0:00:06.912]
{0x3086, 0x1D8D}, // SEQ_DATA_PORT - [0:00:06.915]
{0x3086, 0x6057}, // SEQ_DATA_PORT - [0:00:06.917]
{0x3086, 0x5449}, // SEQ_DATA_PORT - [0:00:06.919]
{0x3086, 0x5F53}, // SEQ_DATA_PORT - [0:00:06.922]
{0x3086, 0x0553}, // SEQ_DATA_PORT - [0:00:06.924]
{0x3086, 0x074D}, // SEQ_DATA_PORT - [0:00:06.927]
{0x3086, 0x2BF8}, // SEQ_DATA_PORT - [0:00:06.929]
{0x3086, 0x1016}, // SEQ_DATA_PORT - [0:00:06.931]
{0x3086, 0x4C08}, // SEQ_DATA_PORT - [0:00:06.933]
{0x3086, 0x5556}, // SEQ_DATA_PORT - [0:00:06.936]
{0x3086, 0x2BB8}, // SEQ_DATA_PORT - [0:00:06.939]
{0x3086, 0x2B98}, // SEQ_DATA_PORT - [0:00:06.941]
{0x3086, 0x4E11}, // SEQ_DATA_PORT - [0:00:06.944]
{0x3086, 0x2904}, // SEQ_DATA_PORT - [0:00:06.946]
{0x3086, 0x2984}, // SEQ_DATA_PORT - [0:00:06.949]
{0x3086, 0x2994}, // SEQ_DATA_PORT - [0:00:06.951]
{0x3086, 0x605C}, // SEQ_DATA_PORT - [0:00:06.954]
{0x3086, 0x195C}, // SEQ_DATA_PORT - [0:00:06.956]
{0x3086, 0x1B45}, // SEQ_DATA_PORT - [0:00:06.959]
{0x3086, 0x4845}, // SEQ_DATA_PORT - [0:00:06.961]
{0x3086, 0x0845}, // SEQ_DATA_PORT - [0:00:06.964]
{0x3086, 0x8829}, // SEQ_DATA_PORT - [0:00:06.966]
{0x3086, 0xB68E}, // SEQ_DATA_PORT - [0:00:06.969]
{0x3086, 0x012A}, // SEQ_DATA_PORT - [0:00:06.971]
{0x3086, 0xF83E}, // SEQ_DATA_PORT - [0:00:06.974]
{0x3086, 0x022A}, // SEQ_DATA_PORT - [0:00:06.976]
{0x3086, 0xFA3F}, // SEQ_DATA_PORT - [0:00:06.979]
{0x3086, 0x095C}, // SEQ_DATA_PORT - [0:00:06.981]
{0x3086, 0x1B29}, // SEQ_DATA_PORT - [0:00:06.984]
{0x3086, 0xB23F}, // SEQ_DATA_PORT - [0:00:06.986]
{0x3086, 0x0C3E}, // SEQ_DATA_PORT - [0:00:06.989]
{0x3086, 0x023E}, // SEQ_DATA_PORT - [0:00:06.991]
{0x3086, 0x135C}, // SEQ_DATA_PORT - [0:00:06.994]
{0x3086, 0x133F}, // SEQ_DATA_PORT - [0:00:06.996]
{0x3086, 0x113E}, // SEQ_DATA_PORT - [0:00:06.999]
{0x3086, 0x0B5F}, // SEQ_DATA_PORT - [0:00:07.001]
{0x3086, 0x2B90}, // SEQ_DATA_PORT - [0:00:07.004]
{0x3086, 0x2AF2}, // SEQ_DATA_PORT - [0:00:07.006]
{0x3086, 0x2B80}, // SEQ_DATA_PORT - [0:00:07.009]
{0x3086, 0x3E04}, // SEQ_DATA_PORT - [0:00:07.011]
{0x3086, 0x3F06}, // SEQ_DATA_PORT - [0:00:07.014]
{0x3086, 0x6029}, // SEQ_DATA_PORT - [0:00:07.016]
{0x3086, 0xA229}, // SEQ_DATA_PORT - [0:00:07.019]
{0x3086, 0xA35F}, // SEQ_DATA_PORT - [0:00:07.021]
{0x3086, 0x4D1C}, // SEQ_DATA_PORT - [0:00:07.024]
{0x3086, 0x2AFA}, // SEQ_DATA_PORT - [0:00:07.026]
{0x3086, 0x2983}, // SEQ_DATA_PORT - [0:00:07.029]
{0x3086, 0x45A8}, // SEQ_DATA_PORT - [0:00:07.031]
{0x3086, 0x3E07}, // SEQ_DATA_PORT - [0:00:07.033]
{0x3086, 0x2AFB}, // SEQ_DATA_PORT - [0:00:07.036]
{0x3086, 0x3E29}, // SEQ_DATA_PORT - [0:00:07.039]
{0x3086, 0x4588}, // SEQ_DATA_PORT - [0:00:07.041]
{0x3086, 0x243E}, // SEQ_DATA_PORT - [0:00:07.044]
{0x3086, 0x082A}, // SEQ_DATA_PORT - [0:00:07.046]
{0x3086, 0xFA5D}, // SEQ_DATA_PORT - [0:00:07.049]
{0x3086, 0x2992}, // SEQ_DATA_PORT - [0:00:07.051]
{0x3086, 0x8810}, // SEQ_DATA_PORT - [0:00:07.054]
{0x3086, 0x2B04}, // SEQ_DATA_PORT - [0:00:07.056]
{0x3086, 0x8B16}, // SEQ_DATA_PORT - [0:00:07.059]
{0x3086, 0x868D}, // SEQ_DATA_PORT - [0:00:07.061]
{0x3086, 0x484D}, // SEQ_DATA_PORT - [0:00:07.064]
{0x3086, 0x4E2B}, // SEQ_DATA_PORT - [0:00:07.066]
{0x3086, 0x804C}, // SEQ_DATA_PORT - [0:00:07.069]
{0x3086, 0x0B60}, // SEQ_DATA_PORT - [0:00:07.071]
{0x3086, 0x3F28}, // SEQ_DATA_PORT - [0:00:07.074]
{0x3086, 0x2AF2}, // SEQ_DATA_PORT - [0:00:07.076]
{0x3086, 0x3F0F}, // SEQ_DATA_PORT - [0:00:07.079]
{0x3086, 0x2982}, // SEQ_DATA_PORT - [0:00:07.081]
{0x3086, 0x2983}, // SEQ_DATA_PORT - [0:00:07.084]
{0x3086, 0x2943}, // SEQ_DATA_PORT - [0:00:07.086]
{0x3086, 0x5C15}, // SEQ_DATA_PORT - [0:00:07.089]
{0x3086, 0x5F4D}, // SEQ_DATA_PORT - [0:00:07.091]
{0x3086, 0x1C2A}, // SEQ_DATA_PORT - [0:00:07.094]
{0x3086, 0xFA45}, // SEQ_DATA_PORT - [0:00:07.096]
{0x3086, 0x588E}, // SEQ_DATA_PORT - [0:00:07.099]
{0x3086, 0x002A}, // SEQ_DATA_PORT - [0:00:07.101]
{0x3086, 0x983F}, // SEQ_DATA_PORT - [0:00:07.104]
{0x3086, 0x064A}, // SEQ_DATA_PORT - [0:00:07.106]
{0x3086, 0x739D}, // SEQ_DATA_PORT - [0:00:07.109]
{0x3086, 0x0A43}, // SEQ_DATA_PORT - [0:00:07.111]
{0x3086, 0x160B}, // SEQ_DATA_PORT - [0:00:07.114]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:07.116]
{0x3086, 0x8E03}, // SEQ_DATA_PORT - [0:00:07.119]
{0x3086, 0x2A9C}, // SEQ_DATA_PORT - [0:00:07.121]
{0x3086, 0x4578}, // SEQ_DATA_PORT - [0:00:07.124]
{0x3086, 0x3F07}, // SEQ_DATA_PORT - [0:00:07.126]
{0x3086, 0x2A9D}, // SEQ_DATA_PORT - [0:00:07.129]
{0x3086, 0x3E12}, // SEQ_DATA_PORT - [0:00:07.131]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:07.134]
{0x3086, 0x3F04}, // SEQ_DATA_PORT - [0:00:07.136]
{0x3086, 0x8E01}, // SEQ_DATA_PORT - [0:00:07.139]
{0x3086, 0x2A98}, // SEQ_DATA_PORT - [0:00:07.142]
{0x3086, 0x8E00}, // SEQ_DATA_PORT - [0:00:07.144]
{0x3086, 0x9176}, // SEQ_DATA_PORT - [0:00:07.147]
{0x3086, 0x9C77}, // SEQ_DATA_PORT - [0:00:07.149]
{0x3086, 0x9C46}, // SEQ_DATA_PORT - [0:00:07.152]
{0x3086, 0x4416}, // SEQ_DATA_PORT - [0:00:07.154]
{0x3086, 0x1690}, // SEQ_DATA_PORT - [0:00:07.157]
{0x3086, 0x7A12}, // SEQ_DATA_PORT - [0:00:07.160]
{0x3086, 0x444B}, // SEQ_DATA_PORT - [0:00:07.162]
{0x3086, 0x4A00}, // SEQ_DATA_PORT - [0:00:07.165]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:07.167]
{0x3086, 0x6343}, // SEQ_DATA_PORT - [0:00:07.170]
{0x3086, 0x1608}, // SEQ_DATA_PORT - [0:00:07.172]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:07.175]
{0x3086, 0x5043}, // SEQ_DATA_PORT - [0:00:07.178]
{0x3086, 0x1665}, // SEQ_DATA_PORT - [0:00:07.180]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:07.183]
{0x3086, 0x6643}, // SEQ_DATA_PORT - [0:00:07.185]
{0x3086, 0x168E}, // SEQ_DATA_PORT - [0:00:07.188]
{0x3086, 0x032A}, // SEQ_DATA_PORT - [0:00:07.191]
{0x3086, 0x9C45}, // SEQ_DATA_PORT - [0:00:07.193]
{0x3086, 0x783F}, // SEQ_DATA_PORT - [0:00:07.196]
{0x3086, 0x072A}, // SEQ_DATA_PORT - [0:00:07.199]
{0x3086, 0x9D5D}, // SEQ_DATA_PORT - [0:00:07.201]
{0x3086, 0x0C29}, // SEQ_DATA_PORT - [0:00:07.204]
{0x3086, 0x4488}, // SEQ_DATA_PORT - [0:00:07.207]
{0x3086, 0x102B}, // SEQ_DATA_PORT - [0:00:07.209]
{0x3086, 0x0453}, // SEQ_DATA_PORT - [0:00:07.212]
{0x3086, 0x0D8B}, // SEQ_DATA_PORT - [0:00:07.215]
{0x3086, 0x1686}, // SEQ_DATA_PORT - [0:00:07.217]
{0x3086, 0x3E1F}, // SEQ_DATA_PORT - [0:00:07.220]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:07.223]
{0x3086, 0x283E}, // SEQ_DATA_PORT - [0:00:07.225]
{0x3086, 0x068E}, // SEQ_DATA_PORT - [0:00:07.228]
{0x3086, 0x012A}, // SEQ_DATA_PORT - [0:00:07.231]
{0x3086, 0x988E}, // SEQ_DATA_PORT - [0:00:07.233]
{0x3086, 0x008D}, // SEQ_DATA_PORT - [0:00:07.236]
{0x3086, 0x6012}, // SEQ_DATA_PORT - [0:00:07.239]
{0x3086, 0x444B}, // SEQ_DATA_PORT - [0:00:07.241]
{0x3086, 0x2C2C}, // SEQ_DATA_PORT - [0:00:07.244]
{0x3086, 0x2C2C}, // SEQ_DATA_PORT - [0:00:07.247]
{0x3ED6, 0x34B3}, // DAC_LD_10_11 - [0:00:07.256]
{0x2436, 0x000E}, // ALTM_CONTROL_AVERAGED_LUMA_NOISE_FLOOR - [0:00:07.262]
{0x320C, 0x0180}, // ADACD_GAIN_THRESHOLD_0 - [0:00:07.267]
{0x320E, 0x0300}, // ADACD_GAIN_THRESHOLD_1 - [0:00:07.273]
{0x3210, 0x0500}, // ADACD_GAIN_THRESHOLD_2 - [0:00:07.279]
{0x3204, 0x0B6D}, // ADACD_NOISE_MODEL2 - [0:00:07.285]
{0x30FE, 0x0080}, // NOISE_PEDESTAL - [0:00:07.290]
{0x3ED8, 0x7B99}, // DAC_LD_12_13 - [0:00:07.296]
{0x3EDC, 0x9BA8}, // DAC_LD_16_17 - [0:00:07.302]
{0x3EDA, 0x9B9B}, // DAC_LD_14_15 - [0:00:07.307]
{0x3092, 0x006F}, // ROW_NOISE_CONTROL - [0:00:07.313]
{0x3EEC, 0x1C04}, // DAC_LD_32_33 - [0:00:07.319]
{0x30BA, 0x779C}, // DIGITAL_CTRL - [0:00:07.324]
{0x3EF6, 0xA70F}, // DAC_LD_42_43 - [0:00:07.330]
{0x3044, 0x0410}, // DARK_CONTROL - [0:00:07.369]
{0x3ED0, 0xFF44}, // DAC_LD_4_5 - [0:00:07.374]
{0x3ED4, 0x031F}, // DAC_LD_8_9 - [0:00:07.380]
{0x30FE, 0x0080}, // NOISE_PEDESTAL - [0:00:07.383]
{0x3EE2, 0x8866}, // DAC_LD_22_23 - [0:00:07.388]
{0x3EE4, 0x6623}, // DAC_LD_24_25 - [0:00:07.394]
{0x3EE6, 0x2263}, // DAC_LD_26_27 - [0:00:07.399]
{0x30E0, 0x4283}, // ADC_COMMAND1 - [0:00:07.405]
{0x30F0, 0x1283}, // ADC_COMMAND1_HS - [0:00:07.410]
{0x301A, 0x0058}, // RESET_REGISTER - [0:00:07.413]
{0x30B0, 0x1118}, // DIGITAL_TEST - [0:00:07.418]
{0x31AC, 0x100C}, // DATA_FORMAT_BITS - [0:00:07.421]
{0x302A, 0x000C}, // VT_PIX_CLK_DIV - [0:00:07.444]
{0x302C, 0x0001}, // VT_SYS_CLK_DIV - [0:00:07.447]
{0x302E, 0x0004}, // PRE_PLL_CLK_DIV - [0:00:07.449]
{0x3030, 0x004c}, // PLL_MULTIPLIER - [0:00:07.452]
{0x3036, 0x000C}, // OP_PIX_CLK_DIV - [0:00:07.457]
{0x3038, 0x0001}, // OP_SYS_CLK_DIV - [0:00:07.462]
{0x3002, 0x0001}, // Y_ADDR_START - [0:00:07.465]				//lfcui
{0x3004, 0x0000}, // X_ADDR_START - [0:00:07.501]
{0x3006, 0x0439}, // Y_ADDR_END - [0:00:07.524]					//lfcui
{0x3008, 0x077f}, // X_ADDR_END - [0:00:07.554]
{0x300A, 0x0550}, // 46cFRAME_LENGTH_LINES - [0:00:07.559]
{0x300C, 0x045e}, // 45eLINE_LENGTH_PCK - [0:00:07.562]
{0x3012, 0x0416}, // COARSE_INTEGRATION_TIME - [0:00:07.564]
{0x30A2, 0x0001}, // X_ODD_INC - [0:00:07.567]
{0x30A6, 0x0001}, // Y_ODD_INC - [0:00:07.569]
{0x30AE, 0x0001}, // X_ODD_INC_CB - [0:00:07.589]
{0x30A8, 0x0001}, // Y_ODD_INC_CB - [0:00:07.594]
{0x3040, 0xc000}, // READ_MODE - [0:00:07.616]					//lfcui
{0x3082, 0x0004}, //08 04 OPERATION_MODE_CTRL - [0:00:07.622]
{0x3176, 0x0080}, // DELTA_DK_ADJUST_GREENR - [0:00:07.641]
{0x3178, 0x0080}, // DELTA_DK_ADJUST_RED - [0:00:07.646]
{0x317A, 0x0080}, // DELTA_DK_ADJUST_BLUE - [0:00:07.652]
{0x317C, 0x0080}, // DELTA_DK_ADJUST_GREENB - [0:00:07.657]
{0x31E0, 0x0200}, // PIX_DEF_ID - [0:00:07.674]
{0x2420, 0x0010}, // ALTM_FSHARP_V
{0x2440, 0x0002}, // ALTM_CONTROL_DAMPER
{0x2442, 0x00d0}, // ALTM_CONTROL_KEY_K0
{0x301E, 0x0000}, // DATA_PEDESTAL
{0x2450, 0x0000}, // ALTM_OUT_PEDESTAL
{0x320A, 0x0000}, // ADACD_PEDESTAL
{0x31D0, 0x0000}, // COMPANDING
{0x2400, 0x0002}, // ALTM_CONTROL
{0x2410, 0x0020}, // ALTM_POWER_GAIN
{0x2412, 0x0019}, // ALTM_POWER_OFFSET
{0x2444, 0x0000}, // ALTM_CONTROL_KEY_K01_LO
{0x2446, 0x0004}, // ALTM_CONTROL_KEY_K01_HI
{0x2438, 0x0010}, // ALTM_CONTROL_MIN_FACTOR
{0x243A, 0x0020}, // ALTM_CONTROL_MAX_FACTOR
{0x243C, 0x0080}, // ALTM_CONTROL_DARK_FLOOR
{0x243E, 0x0200}, // ALTM_CONTROL_BRIGHT_FLOOR
{0x3206, 0x0a06}, // ADACD_NOISE_FLOOR1
{0x3208, 0x1a12}, // ADACD_NOISE_FLOOR2
{0x3202, 0x00cf}, // ADACD_NOISE_MODEL1
{0x3200, 0x0002}, // ADACD_CONTROL
{0x3190, 0x0000}, // HDR_MC_CTRL4
{0x318A, 0x0E10}, // HDR_MC_CTRL1
{0x318C, 0xC000}, // HDR_MC_CTRL2
{0x318E, 0x0000}, // HDR_MC_CTRL3
{0x3192, 0x0400}, // HDR_MC_CTRL5
{0x3198, 0x28c8}, // HDR_MC_CTRL8
{0x3060, 0x0000}, // ANALOG_GAIN
{0x3096, 0x0080}, // ROW_NOISE_ADJUST_TOP
{0x3098, 0x0080}, // ROW_NOISE_ADJUST_BTM
{0x3100, 0x0000}, // AECTRLREG
{0x30BA, 0x06ec}, // DIGITAL_CTRL
{0x3064, 0x1802}, // SMIA_TEST - [0:00:08.008]
{0x31AE, 0x0302}, // SERIAL_FORMAT - [0:00:08.032]
{0x31C6, 0x0400}, // HISPI_CONTROL_STATUS - [0:00:08.066]
{0x306E, 0x9210},  // DATAPATH_SELECT - [0:00:08.072]
{0x301A, 0x005C},  // RESET_REGISTER - [0:00:08.075]
//{0x301c, 0x0101},						//lfcui
};


const  regval_list AR0230_1080_2_Init_regs[] = {
{0x3088, 0x8000}, // SEQ_CTRL_PORT - [0:00:06.511]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:06.517]
{0x3086, 0x729B}, // SEQ_DATA_PORT - [0:00:06.520]
{0x3086, 0x4A31}, // SEQ_DATA_PORT - [0:00:06.523]
{0x3086, 0x4342}, // SEQ_DATA_PORT - [0:00:06.525]
{0x3086, 0x8E03}, // SEQ_DATA_PORT - [0:00:06.529]
{0x3086, 0x2A14}, // SEQ_DATA_PORT - [0:00:06.532]
{0x3086, 0x4578}, // SEQ_DATA_PORT - [0:00:06.534]
{0x3086, 0x7B3D}, // SEQ_DATA_PORT - [0:00:06.537]
{0x3086, 0xFF3D}, // SEQ_DATA_PORT - [0:00:06.540]
{0x3086, 0xFF3D}, // SEQ_DATA_PORT - [0:00:06.543]
{0x3086, 0xEA2A}, // SEQ_DATA_PORT - [0:00:06.546]
{0x3086, 0x043D}, // SEQ_DATA_PORT - [0:00:06.549]
{0x3086, 0x102A}, // SEQ_DATA_PORT - [0:00:06.552]
{0x3086, 0x052A}, // SEQ_DATA_PORT - [0:00:06.555]
{0x3086, 0x1535}, // SEQ_DATA_PORT - [0:00:06.558]
{0x3086, 0x2A05}, // SEQ_DATA_PORT - [0:00:06.561]
{0x3086, 0x3D10}, // SEQ_DATA_PORT - [0:00:06.564]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:06.567]
{0x3086, 0x2A04}, // SEQ_DATA_PORT - [0:00:06.570]
{0x3086, 0x2A14}, // SEQ_DATA_PORT - [0:00:06.573]
{0x3086, 0x3DFF}, // SEQ_DATA_PORT - [0:00:06.575]
{0x3086, 0x3DFF}, // SEQ_DATA_PORT - [0:00:06.577]
{0x3086, 0x3DEA}, // SEQ_DATA_PORT - [0:00:06.580]
{0x3086, 0x2A04}, // SEQ_DATA_PORT - [0:00:06.582]
{0x3086, 0x622A}, // SEQ_DATA_PORT - [0:00:06.585]
{0x3086, 0x288E}, // SEQ_DATA_PORT - [0:00:06.587]
{0x3086, 0x0036}, // SEQ_DATA_PORT - [0:00:06.590]
{0x3086, 0x2A08}, // SEQ_DATA_PORT - [0:00:06.592]
{0x3086, 0x3D64}, // SEQ_DATA_PORT - [0:00:06.595]
{0x3086, 0x7A3D}, // SEQ_DATA_PORT - [0:00:06.597]
{0x3086, 0x0444}, // SEQ_DATA_PORT - [0:00:06.600]
{0x3086, 0x2C4B}, // SEQ_DATA_PORT - [0:00:06.602]
{0x3086, 0x8F00}, // SEQ_DATA_PORT - [0:00:06.605]
{0x3086, 0x430C}, // SEQ_DATA_PORT - [0:00:06.607]
{0x3086, 0x2D63}, // SEQ_DATA_PORT - [0:00:06.610]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.612]
{0x3086, 0x8E03}, // SEQ_DATA_PORT - [0:00:06.615]
{0x3086, 0x2AFC}, // SEQ_DATA_PORT - [0:00:06.617]
{0x3086, 0x5C1D}, // SEQ_DATA_PORT - [0:00:06.620]
{0x3086, 0x5754}, // SEQ_DATA_PORT - [0:00:06.622]
{0x3086, 0x495F}, // SEQ_DATA_PORT - [0:00:06.625]
{0x3086, 0x5305}, // SEQ_DATA_PORT - [0:00:06.627]
{0x3086, 0x5307}, // SEQ_DATA_PORT - [0:00:06.630]
{0x3086, 0x4D2B}, // SEQ_DATA_PORT - [0:00:06.632]
{0x3086, 0xF810}, // SEQ_DATA_PORT - [0:00:06.635]
{0x3086, 0x164C}, // SEQ_DATA_PORT - [0:00:06.637]
{0x3086, 0x0855}, // SEQ_DATA_PORT - [0:00:06.640]
{0x3086, 0x562B}, // SEQ_DATA_PORT - [0:00:06.642]
{0x3086, 0xB82B}, // SEQ_DATA_PORT - [0:00:06.645]
{0x3086, 0x984E}, // SEQ_DATA_PORT - [0:00:06.647]
{0x3086, 0x1129}, // SEQ_DATA_PORT - [0:00:06.650]
{0x3086, 0x0429}, // SEQ_DATA_PORT - [0:00:06.652]
{0x3086, 0x8429}, // SEQ_DATA_PORT - [0:00:06.655]
{0x3086, 0x9460}, // SEQ_DATA_PORT - [0:00:06.657]
{0x3086, 0x5C19}, // SEQ_DATA_PORT - [0:00:06.660]
{0x3086, 0x5C1B}, // SEQ_DATA_PORT - [0:00:06.662]
{0x3086, 0x4548}, // SEQ_DATA_PORT - [0:00:06.665]
{0x3086, 0x4508}, // SEQ_DATA_PORT - [0:00:06.668]
{0x3086, 0x4588}, // SEQ_DATA_PORT - [0:00:06.670]
{0x3086, 0x29B6}, // SEQ_DATA_PORT - [0:00:06.672]
{0x3086, 0x8E01}, // SEQ_DATA_PORT - [0:00:06.675]
{0x3086, 0x2AF8}, // SEQ_DATA_PORT - [0:00:06.677]
{0x3086, 0x3E02}, // SEQ_DATA_PORT - [0:00:06.680]
{0x3086, 0x2AFA}, // SEQ_DATA_PORT - [0:00:06.682]
{0x3086, 0x3F09}, // SEQ_DATA_PORT - [0:00:06.685]
{0x3086, 0x5C1B}, // SEQ_DATA_PORT - [0:00:06.687]
{0x3086, 0x29B2}, // SEQ_DATA_PORT - [0:00:06.690]
{0x3086, 0x3F0C}, // SEQ_DATA_PORT - [0:00:06.692]
{0x3086, 0x3E02}, // SEQ_DATA_PORT - [0:00:06.695]
{0x3086, 0x3E13}, // SEQ_DATA_PORT - [0:00:06.697]
{0x3086, 0x5C13}, // SEQ_DATA_PORT - [0:00:06.700]
{0x3086, 0x3F11}, // SEQ_DATA_PORT - [0:00:06.702]
{0x3086, 0x3E0B}, // SEQ_DATA_PORT - [0:00:06.705]
{0x3086, 0x5F2B}, // SEQ_DATA_PORT - [0:00:06.707]
{0x3086, 0x902A}, // SEQ_DATA_PORT - [0:00:06.710]
{0x3086, 0xF22B}, // SEQ_DATA_PORT - [0:00:06.712]
{0x3086, 0x803E}, // SEQ_DATA_PORT - [0:00:06.715]
{0x3086, 0x043F}, // SEQ_DATA_PORT - [0:00:06.717]
{0x3086, 0x0660}, // SEQ_DATA_PORT - [0:00:06.720]
{0x3086, 0x29A2}, // SEQ_DATA_PORT - [0:00:06.722]
{0x3086, 0x29A3}, // SEQ_DATA_PORT - [0:00:06.725]
{0x3086, 0x5F4D}, // SEQ_DATA_PORT - [0:00:06.727]
{0x3086, 0x192A}, // SEQ_DATA_PORT - [0:00:06.730]
{0x3086, 0xFA29}, // SEQ_DATA_PORT - [0:00:06.732]
{0x3086, 0x8345}, // SEQ_DATA_PORT - [0:00:06.735]
{0x3086, 0xA83E}, // SEQ_DATA_PORT - [0:00:06.737]
{0x3086, 0x072A}, // SEQ_DATA_PORT - [0:00:06.740]
{0x3086, 0xFB3E}, // SEQ_DATA_PORT - [0:00:06.742]
{0x3086, 0x2945}, // SEQ_DATA_PORT - [0:00:06.745]
{0x3086, 0x8821}, // SEQ_DATA_PORT - [0:00:06.748]
{0x3086, 0x3E08}, // SEQ_DATA_PORT - [0:00:06.750]
{0x3086, 0x2AFA}, // SEQ_DATA_PORT - [0:00:06.753]
{0x3086, 0x5D29}, // SEQ_DATA_PORT - [0:00:06.755]
{0x3086, 0x9288}, // SEQ_DATA_PORT - [0:00:06.758]
{0x3086, 0x102B}, // SEQ_DATA_PORT - [0:00:06.760]
{0x3086, 0x048B}, // SEQ_DATA_PORT - [0:00:06.763]
{0x3086, 0x1685}, // SEQ_DATA_PORT - [0:00:06.765]
{0x3086, 0x8D48}, // SEQ_DATA_PORT - [0:00:06.768]
{0x3086, 0x4D4E}, // SEQ_DATA_PORT - [0:00:06.770]
{0x3086, 0x2B80}, // SEQ_DATA_PORT - [0:00:06.773]
{0x3086, 0x4C0B}, // SEQ_DATA_PORT - [0:00:06.776]
{0x3086, 0x603F}, // SEQ_DATA_PORT - [0:00:06.778]
{0x3086, 0x282A}, // SEQ_DATA_PORT - [0:00:06.780]
{0x3086, 0xF23F}, // SEQ_DATA_PORT - [0:00:06.783]
{0x3086, 0x0F29}, // SEQ_DATA_PORT - [0:00:06.786]
{0x3086, 0x8229}, // SEQ_DATA_PORT - [0:00:06.788]
{0x3086, 0x8329}, // SEQ_DATA_PORT - [0:00:06.791]
{0x3086, 0x435C}, // SEQ_DATA_PORT - [0:00:06.794]
{0x3086, 0x155F}, // SEQ_DATA_PORT - [0:00:06.796]
{0x3086, 0x4D19}, // SEQ_DATA_PORT - [0:00:06.799]
{0x3086, 0x2AFA}, // SEQ_DATA_PORT - [0:00:06.801]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:06.804]
{0x3086, 0x8E00}, // SEQ_DATA_PORT - [0:00:06.806]
{0x3086, 0x2A98}, // SEQ_DATA_PORT - [0:00:06.809]
{0x3086, 0x3F06}, // SEQ_DATA_PORT - [0:00:06.811]
{0x3086, 0x1244}, // SEQ_DATA_PORT - [0:00:06.814]
{0x3086, 0x4A04}, // SEQ_DATA_PORT - [0:00:06.817]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.819]
{0x3086, 0x0543}, // SEQ_DATA_PORT - [0:00:06.822]
{0x3086, 0x1658}, // SEQ_DATA_PORT - [0:00:06.824]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.827]
{0x3086, 0x5A43}, // SEQ_DATA_PORT - [0:00:06.830]
{0x3086, 0x1606}, // SEQ_DATA_PORT - [0:00:06.832]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.835]
{0x3086, 0x0743}, // SEQ_DATA_PORT - [0:00:06.838]
{0x3086, 0x168E}, // SEQ_DATA_PORT - [0:00:06.840]
{0x3086, 0x032A}, // SEQ_DATA_PORT - [0:00:06.843]
{0x3086, 0x9C45}, // SEQ_DATA_PORT - [0:00:06.845]
{0x3086, 0x787B}, // SEQ_DATA_PORT - [0:00:06.848]
{0x3086, 0x3F07}, // SEQ_DATA_PORT - [0:00:06.850]
{0x3086, 0x2A9D}, // SEQ_DATA_PORT - [0:00:06.853]
{0x3086, 0x3E2E}, // SEQ_DATA_PORT - [0:00:06.856]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:06.858]
{0x3086, 0x253E}, // SEQ_DATA_PORT - [0:00:06.861]
{0x3086, 0x068E}, // SEQ_DATA_PORT - [0:00:06.864]
{0x3086, 0x012A}, // SEQ_DATA_PORT - [0:00:06.866]
{0x3086, 0x988E}, // SEQ_DATA_PORT - [0:00:06.869]
{0x3086, 0x0012}, // SEQ_DATA_PORT - [0:00:06.872]
{0x3086, 0x444B}, // SEQ_DATA_PORT - [0:00:06.874]
{0x3086, 0x0343}, // SEQ_DATA_PORT - [0:00:06.877]
{0x3086, 0x2D46}, // SEQ_DATA_PORT - [0:00:06.880]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:06.882]
{0x3086, 0xA343}, // SEQ_DATA_PORT - [0:00:06.885]
{0x3086, 0x165D}, // SEQ_DATA_PORT - [0:00:06.888]
{0x3086, 0x0D29}, // SEQ_DATA_PORT - [0:00:06.890]
{0x3086, 0x4488}, // SEQ_DATA_PORT - [0:00:06.894]
{0x3086, 0x102B}, // SEQ_DATA_PORT - [0:00:06.896]
{0x3086, 0x0453}, // SEQ_DATA_PORT - [0:00:06.899]
{0x3086, 0x0D8B}, // SEQ_DATA_PORT - [0:00:06.902]
{0x3086, 0x1685}, // SEQ_DATA_PORT - [0:00:06.904]
{0x3086, 0x448E}, // SEQ_DATA_PORT - [0:00:06.907]
{0x3086, 0x032A}, // SEQ_DATA_PORT - [0:00:06.910]
{0x3086, 0xFC5C}, // SEQ_DATA_PORT - [0:00:06.912]
{0x3086, 0x1D8D}, // SEQ_DATA_PORT - [0:00:06.915]
{0x3086, 0x6057}, // SEQ_DATA_PORT - [0:00:06.917]
{0x3086, 0x5449}, // SEQ_DATA_PORT - [0:00:06.919]
{0x3086, 0x5F53}, // SEQ_DATA_PORT - [0:00:06.922]
{0x3086, 0x0553}, // SEQ_DATA_PORT - [0:00:06.924]
{0x3086, 0x074D}, // SEQ_DATA_PORT - [0:00:06.927]
{0x3086, 0x2BF8}, // SEQ_DATA_PORT - [0:00:06.929]
{0x3086, 0x1016}, // SEQ_DATA_PORT - [0:00:06.931]
{0x3086, 0x4C08}, // SEQ_DATA_PORT - [0:00:06.933]
{0x3086, 0x5556}, // SEQ_DATA_PORT - [0:00:06.936]
{0x3086, 0x2BB8}, // SEQ_DATA_PORT - [0:00:06.939]
{0x3086, 0x2B98}, // SEQ_DATA_PORT - [0:00:06.941]
{0x3086, 0x4E11}, // SEQ_DATA_PORT - [0:00:06.944]
{0x3086, 0x2904}, // SEQ_DATA_PORT - [0:00:06.946]
{0x3086, 0x2984}, // SEQ_DATA_PORT - [0:00:06.949]
{0x3086, 0x2994}, // SEQ_DATA_PORT - [0:00:06.951]
{0x3086, 0x605C}, // SEQ_DATA_PORT - [0:00:06.954]
{0x3086, 0x195C}, // SEQ_DATA_PORT - [0:00:06.956]
{0x3086, 0x1B45}, // SEQ_DATA_PORT - [0:00:06.959]
{0x3086, 0x4845}, // SEQ_DATA_PORT - [0:00:06.961]
{0x3086, 0x0845}, // SEQ_DATA_PORT - [0:00:06.964]
{0x3086, 0x8829}, // SEQ_DATA_PORT - [0:00:06.966]
{0x3086, 0xB68E}, // SEQ_DATA_PORT - [0:00:06.969]
{0x3086, 0x012A}, // SEQ_DATA_PORT - [0:00:06.971]
{0x3086, 0xF83E}, // SEQ_DATA_PORT - [0:00:06.974]
{0x3086, 0x022A}, // SEQ_DATA_PORT - [0:00:06.976]
{0x3086, 0xFA3F}, // SEQ_DATA_PORT - [0:00:06.979]
{0x3086, 0x095C}, // SEQ_DATA_PORT - [0:00:06.981]
{0x3086, 0x1B29}, // SEQ_DATA_PORT - [0:00:06.984]
{0x3086, 0xB23F}, // SEQ_DATA_PORT - [0:00:06.986]
{0x3086, 0x0C3E}, // SEQ_DATA_PORT - [0:00:06.989]
{0x3086, 0x023E}, // SEQ_DATA_PORT - [0:00:06.991]
{0x3086, 0x135C}, // SEQ_DATA_PORT - [0:00:06.994]
{0x3086, 0x133F}, // SEQ_DATA_PORT - [0:00:06.996]
{0x3086, 0x113E}, // SEQ_DATA_PORT - [0:00:06.999]
{0x3086, 0x0B5F}, // SEQ_DATA_PORT - [0:00:07.001]
{0x3086, 0x2B90}, // SEQ_DATA_PORT - [0:00:07.004]
{0x3086, 0x2AF2}, // SEQ_DATA_PORT - [0:00:07.006]
{0x3086, 0x2B80}, // SEQ_DATA_PORT - [0:00:07.009]
{0x3086, 0x3E04}, // SEQ_DATA_PORT - [0:00:07.011]
{0x3086, 0x3F06}, // SEQ_DATA_PORT - [0:00:07.014]
{0x3086, 0x6029}, // SEQ_DATA_PORT - [0:00:07.016]
{0x3086, 0xA229}, // SEQ_DATA_PORT - [0:00:07.019]
{0x3086, 0xA35F}, // SEQ_DATA_PORT - [0:00:07.021]
{0x3086, 0x4D1C}, // SEQ_DATA_PORT - [0:00:07.024]
{0x3086, 0x2AFA}, // SEQ_DATA_PORT - [0:00:07.026]
{0x3086, 0x2983}, // SEQ_DATA_PORT - [0:00:07.029]
{0x3086, 0x45A8}, // SEQ_DATA_PORT - [0:00:07.031]
{0x3086, 0x3E07}, // SEQ_DATA_PORT - [0:00:07.033]
{0x3086, 0x2AFB}, // SEQ_DATA_PORT - [0:00:07.036]
{0x3086, 0x3E29}, // SEQ_DATA_PORT - [0:00:07.039]
{0x3086, 0x4588}, // SEQ_DATA_PORT - [0:00:07.041]
{0x3086, 0x243E}, // SEQ_DATA_PORT - [0:00:07.044]
{0x3086, 0x082A}, // SEQ_DATA_PORT - [0:00:07.046]
{0x3086, 0xFA5D}, // SEQ_DATA_PORT - [0:00:07.049]
{0x3086, 0x2992}, // SEQ_DATA_PORT - [0:00:07.051]
{0x3086, 0x8810}, // SEQ_DATA_PORT - [0:00:07.054]
{0x3086, 0x2B04}, // SEQ_DATA_PORT - [0:00:07.056]
{0x3086, 0x8B16}, // SEQ_DATA_PORT - [0:00:07.059]
{0x3086, 0x868D}, // SEQ_DATA_PORT - [0:00:07.061]
{0x3086, 0x484D}, // SEQ_DATA_PORT - [0:00:07.064]
{0x3086, 0x4E2B}, // SEQ_DATA_PORT - [0:00:07.066]
{0x3086, 0x804C}, // SEQ_DATA_PORT - [0:00:07.069]
{0x3086, 0x0B60}, // SEQ_DATA_PORT - [0:00:07.071]
{0x3086, 0x3F28}, // SEQ_DATA_PORT - [0:00:07.074]
{0x3086, 0x2AF2}, // SEQ_DATA_PORT - [0:00:07.076]
{0x3086, 0x3F0F}, // SEQ_DATA_PORT - [0:00:07.079]
{0x3086, 0x2982}, // SEQ_DATA_PORT - [0:00:07.081]
{0x3086, 0x2983}, // SEQ_DATA_PORT - [0:00:07.084]
{0x3086, 0x2943}, // SEQ_DATA_PORT - [0:00:07.086]
{0x3086, 0x5C15}, // SEQ_DATA_PORT - [0:00:07.089]
{0x3086, 0x5F4D}, // SEQ_DATA_PORT - [0:00:07.091]
{0x3086, 0x1C2A}, // SEQ_DATA_PORT - [0:00:07.094]
{0x3086, 0xFA45}, // SEQ_DATA_PORT - [0:00:07.096]
{0x3086, 0x588E}, // SEQ_DATA_PORT - [0:00:07.099]
{0x3086, 0x002A}, // SEQ_DATA_PORT - [0:00:07.101]
{0x3086, 0x983F}, // SEQ_DATA_PORT - [0:00:07.104]
{0x3086, 0x064A}, // SEQ_DATA_PORT - [0:00:07.106]
{0x3086, 0x739D}, // SEQ_DATA_PORT - [0:00:07.109]
{0x3086, 0x0A43}, // SEQ_DATA_PORT - [0:00:07.111]
{0x3086, 0x160B}, // SEQ_DATA_PORT - [0:00:07.114]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:07.116]
{0x3086, 0x8E03}, // SEQ_DATA_PORT - [0:00:07.119]
{0x3086, 0x2A9C}, // SEQ_DATA_PORT - [0:00:07.121]
{0x3086, 0x4578}, // SEQ_DATA_PORT - [0:00:07.124]
{0x3086, 0x3F07}, // SEQ_DATA_PORT - [0:00:07.126]
{0x3086, 0x2A9D}, // SEQ_DATA_PORT - [0:00:07.129]
{0x3086, 0x3E12}, // SEQ_DATA_PORT - [0:00:07.131]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:07.134]
{0x3086, 0x3F04}, // SEQ_DATA_PORT - [0:00:07.136]
{0x3086, 0x8E01}, // SEQ_DATA_PORT - [0:00:07.139]
{0x3086, 0x2A98}, // SEQ_DATA_PORT - [0:00:07.142]
{0x3086, 0x8E00}, // SEQ_DATA_PORT - [0:00:07.144]
{0x3086, 0x9176}, // SEQ_DATA_PORT - [0:00:07.147]
{0x3086, 0x9C77}, // SEQ_DATA_PORT - [0:00:07.149]
{0x3086, 0x9C46}, // SEQ_DATA_PORT - [0:00:07.152]
{0x3086, 0x4416}, // SEQ_DATA_PORT - [0:00:07.154]
{0x3086, 0x1690}, // SEQ_DATA_PORT - [0:00:07.157]
{0x3086, 0x7A12}, // SEQ_DATA_PORT - [0:00:07.160]
{0x3086, 0x444B}, // SEQ_DATA_PORT - [0:00:07.162]
{0x3086, 0x4A00}, // SEQ_DATA_PORT - [0:00:07.165]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:07.167]
{0x3086, 0x6343}, // SEQ_DATA_PORT - [0:00:07.170]
{0x3086, 0x1608}, // SEQ_DATA_PORT - [0:00:07.172]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:07.175]
{0x3086, 0x5043}, // SEQ_DATA_PORT - [0:00:07.178]
{0x3086, 0x1665}, // SEQ_DATA_PORT - [0:00:07.180]
{0x3086, 0x4316}, // SEQ_DATA_PORT - [0:00:07.183]
{0x3086, 0x6643}, // SEQ_DATA_PORT - [0:00:07.185]
{0x3086, 0x168E}, // SEQ_DATA_PORT - [0:00:07.188]
{0x3086, 0x032A}, // SEQ_DATA_PORT - [0:00:07.191]
{0x3086, 0x9C45}, // SEQ_DATA_PORT - [0:00:07.193]
{0x3086, 0x783F}, // SEQ_DATA_PORT - [0:00:07.196]
{0x3086, 0x072A}, // SEQ_DATA_PORT - [0:00:07.199]
{0x3086, 0x9D5D}, // SEQ_DATA_PORT - [0:00:07.201]
{0x3086, 0x0C29}, // SEQ_DATA_PORT - [0:00:07.204]
{0x3086, 0x4488}, // SEQ_DATA_PORT - [0:00:07.207]
{0x3086, 0x102B}, // SEQ_DATA_PORT - [0:00:07.209]
{0x3086, 0x0453}, // SEQ_DATA_PORT - [0:00:07.212]
{0x3086, 0x0D8B}, // SEQ_DATA_PORT - [0:00:07.215]
{0x3086, 0x1686}, // SEQ_DATA_PORT - [0:00:07.217]
{0x3086, 0x3E1F}, // SEQ_DATA_PORT - [0:00:07.220]
{0x3086, 0x4558}, // SEQ_DATA_PORT - [0:00:07.223]
{0x3086, 0x283E}, // SEQ_DATA_PORT - [0:00:07.225]
{0x3086, 0x068E}, // SEQ_DATA_PORT - [0:00:07.228]
{0x3086, 0x012A}, // SEQ_DATA_PORT - [0:00:07.231]
{0x3086, 0x988E}, // SEQ_DATA_PORT - [0:00:07.233]
{0x3086, 0x008D}, // SEQ_DATA_PORT - [0:00:07.236]
{0x3086, 0x6012}, // SEQ_DATA_PORT - [0:00:07.239]
{0x3086, 0x444B}, // SEQ_DATA_PORT - [0:00:07.241]
{0x3086, 0x2C2C}, // SEQ_DATA_PORT - [0:00:07.244]
{0x3086, 0x2C2C}, // SEQ_DATA_PORT - [0:00:07.247]
{0x3ED6, 0x34B3}, // DAC_LD_10_11 - [0:00:07.256]
{0x2436, 0x000E}, // ALTM_CONTROL_AVERAGED_LUMA_NOISE_FLOOR - [0:00:07.262]
{0x320C, 0x0180}, // ADACD_GAIN_THRESHOLD_0 - [0:00:07.267]
{0x320E, 0x0300}, // ADACD_GAIN_THRESHOLD_1 - [0:00:07.273]
{0x3210, 0x0500}, // ADACD_GAIN_THRESHOLD_2 - [0:00:07.279]
{0x3204, 0x0B6D}, // ADACD_NOISE_MODEL2 - [0:00:07.285]
{0x30FE, 0x0080}, // NOISE_PEDESTAL - [0:00:07.290]
{0x3ED8, 0x7B99}, // DAC_LD_12_13 - [0:00:07.296]
{0x3EDC, 0x9BA8}, // DAC_LD_16_17 - [0:00:07.302]
{0x3EDA, 0x9B9B}, // DAC_LD_14_15 - [0:00:07.307]
{0x3092, 0x006F}, // ROW_NOISE_CONTROL - [0:00:07.313]
{0x3EEC, 0x1C04}, // DAC_LD_32_33 - [0:00:07.319]
{0x30BA, 0x779C}, // DIGITAL_CTRL - [0:00:07.324]
{0x3EF6, 0xA70F}, // DAC_LD_42_43 - [0:00:07.330]
{0x3044, 0x0410}, // DARK_CONTROL - [0:00:07.369]
{0x3ED0, 0xFF44}, // DAC_LD_4_5 - [0:00:07.374]
{0x3ED4, 0x031F}, // DAC_LD_8_9 - [0:00:07.380]
{0x30FE, 0x0080}, // NOISE_PEDESTAL - [0:00:07.383]
{0x3EE2, 0x8866}, // DAC_LD_22_23 - [0:00:07.388]
{0x3EE4, 0x6623}, // DAC_LD_24_25 - [0:00:07.394]
{0x3EE6, 0x2263}, // DAC_LD_26_27 - [0:00:07.399]
{0x30E0, 0x4283}, // ADC_COMMAND1 - [0:00:07.405]
{0x30F0, 0x1283}, // ADC_COMMAND1_HS - [0:00:07.410]
{0x301A, 0x0058}, // RESET_REGISTER - [0:00:07.413]
{0x30B0, 0x1118}, // DIGITAL_TEST - [0:00:07.418]
{0x31AC, 0x100C}, // DATA_FORMAT_BITS - [0:00:07.421]
{0x302A, 0x000C}, // VT_PIX_CLK_DIV - [0:00:07.444]
{0x302C, 0x0001}, // VT_SYS_CLK_DIV - [0:00:07.447]
{0x302E, 0x0004}, // PRE_PLL_CLK_DIV - [0:00:07.449]
{0x3030, 0x004c}, // PLL_MULTIPLIER - [0:00:07.452]
{0x3036, 0x000C}, // OP_PIX_CLK_DIV - [0:00:07.457]
{0x3038, 0x0001}, // OP_SYS_CLK_DIV - [0:00:07.462]
{0x3002, 0x0001}, // Y_ADDR_START - [0:00:07.465]		//lfcui
{0x3004, 0x0000}, // X_ADDR_START - [0:00:07.501]
{0x3006, 0x0439}, // Y_ADDR_END - [0:00:07.524]			//lfcui
{0x3008, 0x077f}, // X_ADDR_END - [0:00:07.554]
{0x300A, 0x0550}, // 46cFRAME_LENGTH_LINES - [0:00:07.559]
{0x300C, 0x045e}, // 45eLINE_LENGTH_PCK - [0:00:07.562]
{0x3012, 0x0416}, // COARSE_INTEGRATION_TIME - [0:00:07.564]
{0x30A2, 0x0001}, // X_ODD_INC - [0:00:07.567]
{0x30A6, 0x0001}, // Y_ODD_INC - [0:00:07.569]
{0x30AE, 0x0001}, // X_ODD_INC_CB - [0:00:07.589]
{0x30A8, 0x0001}, // Y_ODD_INC_CB - [0:00:07.594]
{0x3040, 0xc000}, // READ_MODE - [0:00:07.616]			//lfcui
{0x3082, 0x0004}, //08 04 OPERATION_MODE_CTRL - [0:00:07.622]
{0x3176, 0x0080}, // DELTA_DK_ADJUST_GREENR - [0:00:07.641]
{0x3178, 0x0080}, // DELTA_DK_ADJUST_RED - [0:00:07.646]
{0x317A, 0x0080}, // DELTA_DK_ADJUST_BLUE - [0:00:07.652]
{0x317C, 0x0080}, // DELTA_DK_ADJUST_GREENB - [0:00:07.657]
{0x31E0, 0x0200}, // PIX_DEF_ID - [0:00:07.674]
{0x2420, 0x0010}, // ALTM_FSHARP_V
{0x2440, 0x0002}, // ALTM_CONTROL_DAMPER
{0x2442, 0x00d0}, // ALTM_CONTROL_KEY_K0
{0x301E, 0x0000}, // DATA_PEDESTAL
{0x2450, 0x0000}, // ALTM_OUT_PEDESTAL
{0x320A, 0x0000}, // ADACD_PEDESTAL
{0x31D0, 0x0000}, // COMPANDING
{0x2400, 0x0002}, // ALTM_CONTROL
{0x2410, 0x0020}, // ALTM_POWER_GAIN
{0x2412, 0x0019}, // ALTM_POWER_OFFSET
{0x2444, 0x0000}, // ALTM_CONTROL_KEY_K01_LO
{0x2446, 0x0004}, // ALTM_CONTROL_KEY_K01_HI
{0x2438, 0x0010}, // ALTM_CONTROL_MIN_FACTOR
{0x243A, 0x0020}, // ALTM_CONTROL_MAX_FACTOR
{0x243C, 0x0080}, // ALTM_CONTROL_DARK_FLOOR
{0x243E, 0x0200}, // ALTM_CONTROL_BRIGHT_FLOOR
{0x3206, 0x0a06}, // ADACD_NOISE_FLOOR1
{0x3208, 0x1a12}, // ADACD_NOISE_FLOOR2
{0x3202, 0x00cf}, // ADACD_NOISE_MODEL1
{0x3200, 0x0002}, // ADACD_CONTROL
{0x3190, 0x0000}, // HDR_MC_CTRL4
{0x318A, 0x0E10}, // HDR_MC_CTRL1
{0x318C, 0xC000}, // HDR_MC_CTRL2
{0x318E, 0x0000}, // HDR_MC_CTRL3
{0x3192, 0x0400}, // HDR_MC_CTRL5
{0x3198, 0x28c8}, // HDR_MC_CTRL8
{0x3060, 0x0000}, // ANALOG_GAIN
{0x3096, 0x0080}, // ROW_NOISE_ADJUST_TOP
{0x3098, 0x0080}, // ROW_NOISE_ADJUST_BTM
{0x3100, 0x0000}, // AECTRLREG
{0x30BA, 0x06ec}, // DIGITAL_CTRL
{0x3064, 0x1802}, // SMIA_TEST - [0:00:08.008]
{0x31AE, 0x0302}, // SERIAL_FORMAT - [0:00:08.032]
{0x31C6, 0x0400}, // HISPI_CONTROL_STATUS - [0:00:08.066]
{0x306E, 0x9210},  // DATAPATH_SELECT - [0:00:08.072]
{0x301A, 0x005C},  // RESET_REGISTER - [0:00:08.075]
//{0x301c, 0x0101},
};


int16_t ar0230_check_id(i2c_dev_t *i2c)
{
    int ret = 0;
    uint8_t data[2] = {0};

    printf("check ar0230 id: \n");
	//printf("port %d,devAddr %08x ,handle %x \n",i2c->port,i2c->config.dev_addr,i2c->priv);
    ret = iic_read16bit(i2c, AR0230_REG_CHIPID, data);
	printf("id %02x %02x \n",data[0],data[1]);
	if (ret < 0 || data[0] != 0x00 || data[1] != 0x56)
        return -1;
    
    return ret;
}

int ar0230_init(i2c_dev_t *i2c, uint32_t dev_addr)
{
    int ret = 0;

	//printf("[ar0230_init]:port %d,devAddr %08x ,handle %x \n",i2c->port,i2c->config.dev_addr,i2c->priv);
	
	memcpy(&i2c_ar0230, i2c, sizeof(i2c_dev_t));
	i2c_ar0230.config.dev_addr = dev_addr;
	/* Check the id of camera */
	ret = ar0230_check_id(&i2c_ar0230);
	if (ret < 0) {
		printf("ar0230 check id fail\n");
		return -1;
	}
	printf("ar0230 init success\n");
    return ret;
}

int ar0230_finalize()
{
	return 0;
}


int ar0230_cfg_format(imageFormat_t cfg)
{
	int ret =0;
	if(R_1080P == cfg.res && YUV422 == cfg.format)
	{
		printf("ar0230 size_1920x1080 \n");
		ret = iic_write16bit_array(&i2c_ar0230, (regval_list *)AR0230_1080_2_Init_regs, ARRAY_SIZE(AR0230_1080_2_Init_regs));
	}
	else if(R_720P == cfg.res && YUV422 == cfg.format)
	{
		printf("ar0230 size_1280x720 \n");
		ret = iic_write16bit_array(&i2c_ar0230, (regval_list *)AR0230_Init_regs, ARRAY_SIZE(AR0230_Init_regs));
	}
	
    if (ret < 0) {
        return -1;
    }

#if 0
    ret = ar0230_read16bit_array(&i2c_ar0230, (struct regval_list *)AR0230_Init_regs, ARRAY_SIZE(AR0230_Init_regs));
    if (ret < 0) {
        return -1;
    }
#endif

	return ret;
}


